define([
  'jquery',
  'underscore',
  'backbone',
  
 '../models/innerLayoutModelInstance'
], function($, _, Backbone
, innerLayoutModelInstance){  
		  var photosGridView = Backbone.View.extend({
				tagName:  "div",
				template: _.template($('#photos-item-template').html()),
				events: {
				  "click .link"   : "openPhoto"
				},
				render: function() {
					var content = [];
					var th = this;
					this.model.each(
						function (photoItem) {
							var obj = photoItem.toJSON();
							content.push(th.template(obj));
						}
					);
					this.$el.append('<div>');					
					var elDiv = this.$el.children().attr('id', "photosInAlbum");
					var size = 95;
					elDiv.jresponsive({transormation: 'animation', min_size: size,max_size: size,height:129,hspace: 12,vspace: 12,class_name: 'item',content_array: content});
				},
				openPhoto: function(sender) {
					innerLayoutModelInstance.goForward($(sender.currentTarget).attr('photo-id'));
				}
		  });
		return photosGridView;
});